<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 死循环10s
        function deadLoop(time) {
            var start = Date.now();
            while (Date.now() - start < time) {
                console.log('死循环');
            }
        }

        setTimeout(() => {
            console.log('5s了');
            deadLoop(10000);
        }, 5000);
    </script>
</body>

</html>
